package com.project.easy.common.framework.web.exception;

import  com.project.easy.common.util.enums.exception.ExceptionEnums;
import  com.project.easy.common.util.exception.BaseException;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/10/3 22:46
 * @description: 参数验证异常
 */
public class ParamValidatorException extends BaseException {
    /**
     * 参数验证异常
     * @param subCode 子编码
     * @param subMsg 子消息
     * @param throwable  异常
     */
    public ParamValidatorException(String subCode, String subMsg, Throwable throwable) {
        super(throwable, ExceptionEnums.PARAM_ILLEGAL.getCode(), ExceptionEnums.PARAM_ILLEGAL.getName(), subCode, subMsg);
    }
    /**
     * 参数验证异常
     * @param subCode 子编码
     * @param subMsg 子消息
     */
    public ParamValidatorException(String subCode, String subMsg) {
        super(ExceptionEnums.PARAM_ILLEGAL.getCode(), ExceptionEnums.PARAM_ILLEGAL.getName(), subCode, subMsg);
    }

    @Override
    public String toString() {
        return "ParamValidatorException{"
                +  "sysCode=" + sysCode
                +  ", errorCode=" + errorCode
                +  ", errorMsg=" + errorMsg
                + ", subMsg=" + subMsg
                + '}';
    }
}
